package cn.wolfcode.trip.base.domain;


import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.Date;

@Getter@Setter
public class SystemMessage extends BaseDomain{

    public static final int STATE_UNREAD=0;//消息未读
    public static final int STATE_READ=1;//消息已读

    //系统消息内容
    private String content;
    //用户
    private User user;
    //状态 0 未读 1 已读
    private Long brower;
    //类型 0 默认0 预留字段
    private Integer type;
    //关联游记
    private Travel travel;
    //创建时间
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GTM+8")
    private Date createTime;

    //页面状态回显
    public String getBrowerName() {
        String msg="未读";
        if (brower==STATE_READ) {
            msg="已读";
        }
        return msg;
    }


}